﻿// Copyright 2010 Maxime Serrano <lastchronicler@gmail.com>
using System;
using System.Net;

namespace MCSharp {
    static class BuildCommands {
        internal static void Init() {
            CommandList.RegisterCommand(cdInstant);
        }

        static CommandDescriptor cdInstant = new CommandDescriptor {
            name = "instant",
            aliases = new string[] { "i" },
            permissions = new Permission[] { Permission.UseInstant },
            consoleSafe = false,
            usage = "/instant",
            help = "Toggles instant mode, where your blocks break instantly.",
            handler = cmdToggleInstantMode
        };

        internal static void cmdToggleInstantMode(Player player, Command cmd) {
            if (player.InstantBreak) {
                player.InstantBreak = false;
                player.Message(Color.Announcement + "You are no longer in Instant Break mode.");
            } else {
                player.InstantBreak = true;
                player.Message(Color.Announcement + "You are now in Instant Break mode.");
            }
        }
    }
}
